import http from "@/http";
import qs from 'qs'

// 车型管理
// 页面数据
export const getTypeName = (params:IUserListParams):RES<IUserListModel> => 
http.get("/prod-api/system/type",{params})
// 新增车型
export const getAddType = (params:IAddType) =>
http.post("/prod-api/system/type",params)
// 修改  获取车型
export const getCarId = (id:number):RES<IResourceTypeName> =>
http.get(`/prod-api/system/type/${id}`)
// 修改车型
export const getCarType = (params:IAddType):RES<IResourceTypeName> => 
http.put("/prod-api/system/type",params)
// 删除车型
export const delCarType = (id:number) =>{
    http.delete(`/prod-api/system/type/${id}`)
}
// 搜索
export const searchCarType = (params:IUserListParams):RES<IAddType> => 
http.get("/prod-api/system/type",{params})
// 导出
export const export1 = (params:any,configs:any):RES<any> =>
    http.post("/prod-api/system/type/export",qs.stringify(params),configs)



// 用户管理
// 获取用户列表
export const getUserList = (params:IUserListParams):RES<IUserListModel> =>
http.get("/prod-api/system/user/list",{params})

// 岗位管理
// 页面数据
export const getPostList = (params:IUserListParams):RES<IUserListModel> => 
http.get("/prod-api/system/post/list",{params})
// 修改  数据
export const getPostId = (id:number):RES<IResourceEdit> =>
http.get(`/prod-api/system/post/${id}`)
// 修改成功
export const editPost = (params:IResourceAddPost):RES<IResourceEdit> => 
http.put("/prod-api/system/post",params)

// 新增
export const AddPostApi = (params:IResourceAddPost):RES<IResourceAddPost> =>
http.post("/prod-api/system/post",params)

// 删除
export const delPost = (id:number) =>{
    http.delete(`/prod-api/system/post/${id}`)
}

// 搜索
export const searchPost = (params:IResourceSearchPost):RES<IResourcePost> => 
http.get("/prod-api/system/post/list",{params})

export const exportPost = (params:any,configs:any):RES<any> =>
    http.post("/prod-api/system/post/export",qs.stringify(params),configs)